home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / wordsm10.zip / WORDSMRT.DOC < prev    next >
Text File  |  1993-01-07  |  35KB  |  1,026 lines

  1. WORDSMRT.DOC
  2. Documentation for WordSmart (WSM.EXE), a file-reformatting utility
  3. Version: 1.0
  4. November 1, 1992
  5.  
  6.  WORDSMART and its documentation are Copyright 1992 by:
  7.  
  8.  Lambert Klein
  9.  P.O. Box 611
  10.  Wayne MI  48184
  11.  Voice telephone: (313) 326-1583
  12.  
  13.  GEnie:       L.Klein1
  14.  CompuServe:  72010,624
  15.  Internet:    72010.624@compuserve.com
  16.  AOL:         LKlein3990
  17.  
  18. Member, Association of Shareware Professionals
  19.  
  20. =======================================================
  21.  
  22.          ┌─────────┐
  23.    ┌─────┴───┐     │               (R)
  24.  ──│         │o    │──────────────────
  25.    │   ┌─────┴╨──┐ │  Association of
  26.    │   │         │─┘  Shareware
  27.    └───│    o    │    Professionals
  28.  ──────│    ║    │────────────────────
  29.        └────╨────┘    MEMBER
  30.  
  31. "This program is produced by a member of the Association of
  32. Shareware Professionals (ASP). ASP wants to make sure that the
  33. shareware principle works for you. If you are unable to resolve
  34. a shareware-related problem with an ASP member by contacting
  35. the member directly, ASP may be able to help. The ASP Ombudsman
  36. can help you resolve a dispute or problem with an ASP member,
  37. but does not provide technical support for members' products.
  38. Please write to the ASP Ombudsman at 545 Grover Road Muskegon
  39. MI 49442 or send a Compuserve message via easyplex to ASP
  40. Ombudsman 70007,3536."
  41.  
  42. ============================================================
  43.  
  44.  
  45.       ┌──────────────────────┐
  46.       │  TABLE OF CONTENTS:  │
  47.       └──────────────────────┘
  48.  
  49.      WordSmart is Shareware  ......  page 3
  50.  
  51.      Thanks  ......................  page 3
  52.  
  53.      Purpose of WordSmart  ........  page 4
  54.  
  55.      Features of WordSmart  .......  page 4
  56.  
  57.      Running WordSmart  ...........  page 5
  58.  
  59.      Basic program syntax  ........  page 5
  60.  
  61.      Program options  .............  page 7
  62.  
  63.      Options summary  .............  page 8
  64.  
  65.      Options in detail  ...........  page 8
  66.  
  67.              Left margin  .........  page 8
  68.  
  69.              Right margin  ........  page 9
  70.  
  71.              Removing all EOLs
  72.              within paragraphs  ...  page 11
  73.  
  74.              Preventing reformatting page 12
  75.  
  76.              What happens during
  77.              -R processing  .......  page 13
  78.  
  79.              Write output file  ...  page 14
  80.  
  81.              Over-write existing
  82.              file  ................  page 15
  83.  
  84.              Remove form-feeds  ...  page 16
  85.  
  86.              Remove multiple spaces  page 16
  87.  
  88.              Print registration ...  page 16
  89.  
  90.        Remove blank lines (reg)  ..  page 17
  91.  
  92.        Quiet processing (reg)  ....  page 17
  93.  
  94.      Piping and redirection  ......  page 18
  95.  
  96.      Errorlevels  .................  page 20
  97.  
  98.      Example bat file  ............  page 20
  99.  
  100.      Registration benefits  .......  page 21
  101.  
  102.  
  103.                                                          page 3
  104.  
  105.  
  106. WordSmart is shareware. If you try it out, find it useful, and
  107. go on using it - please register it. Registration is only
  108. $14.00. plus $4.00 shipping and handling.
  109.  
  110. I hope you find WordSmart useful. If you have any comments,
  111. suggestions, bug reports, and so on, please send them to me
  112. at the address shown above. See the file PROGRAMS.TXT, also
  113. in the archive WORDSMRT.ZIP, for information on my other
  114. shareware, including PrintPlus, my menu-driven dot-matrix
  115. printer control program.
  116.  
  117. -- Lambert Klein
  118.  
  119. ============================================================
  120.  
  121.  
  122. Any registered or trademarked product names mentioned in
  123. this documentation are the property of their respective
  124. owners or publishers.
  125.  
  126. ============================================================
  127.  
  128.  
  129.  
  130.  
  131.  ╓┬───────────┬╖
  132.  ║│  THANKS:  │║
  133.  ╙┴───────────┴╜
  134.  
  135. I would like to thank Mike Arst for his continuous testing
  136. and debugging of WordSmart. There have been many hours of testing
  137. and coding put into WordSmart.
  138.  
  139. Thanks goes to the Writer of WordSmart's documentation, who
  140. also happens to be Mike Arst!
  141.  
  142.  
  143.  
  144.                                                          page 4
  145.  ╓┬────────────┐
  146.  ║│  PURPOSE   │
  147.  ╙┴────────────┘
  148.  
  149. WordSmart, written entirely in assembly language, is a fast
  150. reformatter for text files.
  151.  
  152. For instance, WordSmart can increase the line length of text
  153. files created with relatively short lines, perhaps (as with this
  154. file) because the writer assumed you'd be using a typical dot-
  155. matrix printer setup. But if you are using compressed mode for
  156. printing, you might prefer wider lines. WordSmart helps with this
  157. by automatically increasing line lengths for you (or decreasing
  158. them - your choice); you won't have to do so manually in a text
  159. editor or word processor.
  160.  
  161. FEATURES IN BOTH REGISTERED AND UNREGISTERED
  162. VERSIONS OF WORDSMART
  163.  
  164. o   Accepts input in the form of a source file whose name you
  165.     specify on the command line, or accepts input from "standard
  166.     input" (i.e., via a "pipe").
  167.  
  168. o   Writes an output file whose name you specify on the command
  169.     line; otherwise, writes to "standard output," allowing you
  170.     to redirect the results of processing to a file name or
  171.     else "pipe" the output to some other program.
  172.  
  173. o   Can over-write an existing file at your option
  174.  
  175. o   Adds to or removes spaces at the left sides of lines.
  176.  
  177. o   Changes the lengths of lines (from 10 characters wide
  178.     up to 60,000 characters wide). Can be used to remove "hard"
  179.     line breaks within paragraphs completely, preserving the
  180.     paragraph-endings themselves.
  181.  
  182. o   Removes form-feed characters.
  183.  
  184. o   Reduces runs of multiple spaces to a single space.
  185.  
  186. o   Returns errorlevels, useful when WordSmart is run from
  187.     batch files.
  188.  
  189.  
  190. ADDITIONAL FEATURES AVAILABLE ONLY IN THE
  191. REGISTERED VERSION
  192.  
  193. o   Removes blank lines from files.
  194.  
  195. o   "Quiet" mode - no screen display during processing
  196.  
  197.  
  198. The program will usually be referred to hereafter in the
  199. documentation simply as "WSM."
  200.  
  201.  
  202.                                                          page 5
  203.  ╓┬─────────────────┐
  204.  ║│ RUNNING WSM.EXE │
  205.  ╙┴─────────────────┘
  206.  
  207. WSM can read past an EOF character (Control-Z) and will treat it
  208. as if it were an ordinary character. WSM also treats a NULL (with
  209. a decimal value of 0) no differently from any other character.
  210.  
  211. Limitations:
  212.  
  213. Line-ending characters: WSM cannot process files with Unix-style
  214. line endings (line feeds only), nor those with Mac-style line
  215. endings (carriage returns only). The files must have standard DOS
  216. line endings (carriage return plus line feed).
  217.  
  218. Types of input files: WSM is intended for use only with plain-
  219. text files, not files saved in the "document" format of programs
  220. like WordStar, Microsoft Word, or WordPerfect. Using WSM to alter
  221. such files will probably make them unreadable by the word
  222. processing programs that created them.
  223.  
  224.  ╓┬──────────────────────┐
  225.  ║│ BASIC PROGRAM SYNTAX │
  226.  ╙┴──────────────────────┘
  227.  
  228. Typing WSM alone at the DOS prompt brings up a help-screen
  229. containing a summary of the command-line options and information
  230. about the exit codes (errorlevels) WSM returns.
  231.  
  232. Typical command line:
  233.  
  234. WSM input [options] > output
  235.  
  236. Where:
  237.  
  238. input       is the name of the file you want to process;
  239.  
  240. [options]   are one or more of the command-line options
  241.             (switches) discussed below; and
  242.  
  243. > output    is an optional command whereby you use DOS
  244.             redirection to create an output file.
  245.  
  246. NOTE:       THE NAME OF THE FILE TO BE USED FOR INPUT MUST BE
  247.             THE FIRST PARAMETER ON THE COMMAND LINE.
  248.  
  249.             If you do not put the input file name first,
  250.             WordSmart will display an error message ("source
  251.             path error"), and it will halt without doing any
  252.             further work.
  253.  
  254.             The input file name CANNOT contain the DOS
  255.             wildcards "*" or "?".
  256.  
  257.  
  258.                                                          page 6
  259.  
  260. Other ways to write the command line:
  261.  
  262.         WSM input [options] | another_program
  263.  
  264. In this kind of command, you use a "pipe" to send WSM's output
  265. not to a file, but to some other program ("another_program" in
  266. the above example) that can read from "standard input."
  267.  
  268. This also works:
  269.  
  270.         another_program | WSM [options] > output
  271.  
  272.  
  273. In this case, you pipe some other program's output to WSM. Note
  274. that in this case, you do NOT give WSM the name of an input file.
  275. You could use WSM's "write output file" option (see below) or use
  276. "> output."
  277.  
  278. NOTE:  There are some risks to be aware of when using redirection
  279.        to write output files. They will be discussed in greater
  280.        detail in the section called "Piping and output
  281.        redirection."
  282.  
  283. A WSM command line that does not contain a "write output to
  284. file..." command forces the results of processing to be sent only
  285. to "standard output" - to the screen. You can use this to preview
  286. the results of processing and without first having to write an
  287. output file. If you use a program like LIST.COM (a shareware file
  288. viewer by Vernon Buerg), you can pipe output from WSM.EXE to LIST,
  289. thus:
  290.  
  291.         WSM input [switches] | list /s
  292.  
  293. (LIST's "/s" option is required when it is receiving input via
  294. "pipe" like that.)
  295.  
  296.  
  297.                                                          page 7
  298.  
  299.  ╓┬─────────────────┐
  300.  ║│ PROGRAM OPTIONS │
  301.  ╙┴─────────────────┘
  302.  
  303. WordSmart's functions are all invoked with command-line "switches."
  304.  
  305. Each "switch" is a hyphen, followed by a single letter (with no
  306. space between the hyphen and the letter). The case of the letter
  307. is unimportant. Both of the following are "legal" forms of the
  308. "-B" switch:
  309.  
  310.         -b      -B
  311.  
  312. Some switches require additional information, which will be
  313. referred to hereafter as an "argument." For example, -W tells
  314. WSM to write an output file; the output file name argument
  315. follows the -W.
  316.  
  317. You can either add or omit a space between a switch and its
  318. argument. Both of the following are legal ways to add the output
  319. file name argument to the "-w" switch:
  320.  
  321.          -Woutput      -W output
  322.  
  323. There are two possible switch characters: the hyphen and the
  324. forward slash. Either -W or /W would work for the switch used
  325. to specify the output file name. All of the following are "legal"
  326. ways of writing that switch (the file name argument is
  327. represented by the word "output"):
  328.  
  329.         -woutput      -w output      /woutput      /w output
  330.  
  331.         -Woutput      -W output      /Woutput      /W output
  332.  
  333.  
  334.  
  335.                                                          page 8
  336.  ╓┬──────────────────────╖
  337.  ║│ OPTIONS - SUMMARIZED ║
  338.  ╙┴──────────────────────╜
  339.  
  340. Switch   Purpose
  341.  
  342. -L       Specify the left margin; must be followed by a number
  343.          indicating the number of spaces to add at the left
  344.          margin.
  345.  
  346. -R       Specify the right margin; must be followed by a number
  347.          indicating the maximum line width.
  348.  
  349. -W       Write output file; must be followed by the name of the
  350.          file to write.
  351.  
  352. -O       Over-write an existing file without query. This option
  353.          takes no arguments.
  354.  
  355. -F       Remove form-feed characters. This option takes no
  356.          arguments.
  357.  
  358. -S       Remove runs of multiple spaces, reducing the string
  359.          of spaces to one space only. This option takes no
  360.          arguments.
  361.  
  362. -I       Send a WordSmart registration form directly to the
  363.          printer. This option takes no arguments.
  364.  
  365. -B       Remove all blank lines in a file. This option takes no
  366.          arguments. AVAILABLE ONLY IN THE REGISTERED VERSION OF
  367.          WORDSMART.
  368.  
  369. -Q       "Quiet" mode - no screen display at all during or
  370.          after processing. This option takes no arguments.
  371.          AVAILABLE ONLY IN THE REGISTERED VERSION.
  372.  
  373.  
  374.  ╓┬───────────────────────────────┐
  375.  ║│ OPTIONS - DESCRIBED IN DETAIL │
  376.  ╙┴───────────────────────────────┘
  377.  
  378.  
  379.  ┌────────────────────────────────┐
  380.  │ -L   ADD SPACES TO LEFT MARGIN │
  381.  └────────────────────────────────┘
  382.  
  383. "-L" is always followed by a two- or three-digit number
  384. indicating the number of spaces to add at the left of each line
  385. of the input file. Example:
  386.  
  387. -L5  would add 5 spaces to the beginning of each line. If the file
  388. has no left-margin indents at all, the command -L5 would put the
  389. first NON-space character on each line in column 6.
  390.  
  391.  
  392.                                                          page 9
  393.  
  394. If there are already spaces at the start of a line, the -L
  395. command adds the additional spaces to them. For example, a file
  396. whose lines are already indented by two spaces would be
  397. indented by seven spaces after you'd used -L5.
  398.  
  399. In the present version of WSM, the -L command does not REMOVE
  400. spaces from the left margin. Thus, -L0 has no meaning. (Removal
  401. of spaces from the left margin is being considered for a future
  402. version of WordSmart.)
  403.  
  404. Example - if this is a line in the input file:
  405.  
  406. Here is a test line
  407.  
  408. ... it looks this way after processing via -L5:
  409.  
  410.      Here is a test line
  411.  
  412. The first non-space character ("H") is now at column 6.
  413.  
  414. CAUTION:  Numbers higher than 200, used with the -L switch,
  415.           might cause corruption in or truncation of the output
  416.           file.
  417.  
  418.  ┌───────────────────────┐
  419.  │ -R   NEW RIGHT MARGIN │
  420.  └───────────────────────┘
  421. -R is followed by a number 2 to 5 digits long, indicating a new
  422. line width (the number cannot exceed 60000). The number does not
  423. necessarily mean how many characters long the line will be; it is
  424. an "absolute" setting, indicating the right-most COLUMN NUMBER
  425. past which a line must break to a new line. (There's more
  426. information later in this documentation concerning exactly how
  427. WSM makes line-ending decisions).
  428.  
  429. For instance, if the input file has no left-margin indents at
  430. all, and if you use the -R switch with an argument of 50, the
  431. widest possible output line will be 50 characters long. On the
  432. other hand, if you were to use these commands:
  433.  
  434.          -L10  -R50
  435.  
  436. ... then WSM would add 10 spaces to the left margin and re-
  437. format lines out to column 50 (maximum). In that case, there
  438. would be a maximum of 40 characters on each line, NOT including
  439. the spaces added at the beginning of the line.
  440.  
  441.  
  442.                                                          page 10
  443. Example - lines that break at column 25:
  444.  
  445. This is an example of
  446. lines that don't extend
  447. past column 25. The goal
  448. is to re-break them with
  449. the command -R45 so that
  450. they break at column 45.
  451.  
  452. After processing with the command -R45:
  453.  
  454. This is an example of lines that don't extend
  455. past column 25. The goal is to re-break them
  456. with the command -R45 so that they break at
  457. column 45.
  458.  
  459.  
  460. A nonsensical command like  -L40 -R30  would, if taken literally,
  461. add 40 spaces to the start of each line but then try to break all
  462. lines at column 30. If you give WSM an instruction like that, it
  463. ignores the left-margin command entirely and takes only the right-
  464. margin command into account.
  465.  
  466. If you use an argument less than 10, -R defaults to a value of
  467. 10. (There is one notable exception; -R0. See "Removing All Line
  468. Breaks Within Paragraphs," below.)
  469.  
  470. If you have a text file in which each paragraph is a single long
  471. line, use -R plus a two-digit argument (80 or below) if you want to
  472. make the file more easily readable on-screen. But note: If there
  473. are NO blank lines in such a file, and if none of the lines is
  474. indented, processing it with WSM.EXE will cause the entire file to
  475. be treated as a single paragraph, and you'll lose all paragraph
  476. breaks. The solution would be to add blank lines between paragraphs
  477. and then process the file with WSM.
  478.  
  479. Where processing begins and ends:
  480.  
  481. For WordSmart's purposes, a paragraph is one or more lines with
  482. at least one blank line above and below it (them). If a line
  483. appears blank but contains spaces, WSM still treats it as a blank
  484. line. The reason is that, before processing begins, WSM removes any
  485. spaces at the right side of a line - "trailing spaces" - if they
  486. are the last characters before the line boundary. (Thus, a line
  487. containing only spaces has all of its spaces removed before
  488. processing begins.)
  489.  
  490.  
  491.                                                          page 11
  492.  ┌────────────────────────────────────────────┐
  493.  │ REMOVING ALL LINE BREAKS WITHIN PARAGRAPHS │
  494.  └────────────────────────────────────────────┘
  495.  
  496. Omitting the -R switch entirely from the WordSmart command line,
  497. OR using the command -R0 (zero), tells WSM to remove ALL line
  498. endings within paragraphs in the input file. Using -R0 (or no
  499. -R command at all) is a quick way to turn each paragraph of the
  500. input file into a single long line (see below for exceptions,
  501. however).
  502.  
  503. This is useful if you will import the text file into a desktop
  504. publishing (DTP) program. You almost always want a DTP program to
  505. make its own line-ending decisions, but its ability to do so is
  506. always defeated by "hard" line breaks within paragraphs. In the
  507. ideal situation, each paragraph is a single long line, and the
  508. only "hard" line breaks in the file are those at the very ends of
  509. the paragraphs.
  510.  
  511. -R0 (or no -R at all) will preserve the FINAL line boundary of
  512. each paragraph, AS LONG AS THERE IS AT LEAST ONE BLANK LINE ABOVE
  513. AND BELOW EACH PARAGRAPH.
  514.  
  515. Example: Suppose the input file looks like this:
  516.  
  517. Line one.
  518. Line two.
  519. Line three.
  520. Line four.
  521.  
  522. Line five.
  523. Line six.
  524.  
  525. Result of processing the file with -R0 (or no -R command
  526. at all):
  527.  
  528. Line one. Line two. Line three. Line four.
  529.  
  530. Line five. Line six.
  531.  
  532.  
  533.                                                          page 12
  534.  ┌─────────────────────────┐
  535.  │ PREVENTING REFORMATTING │
  536.  └─────────────────────────┘
  537.  
  538. If, while re-breaking lines in a file, WSM encounters a line
  539. that is already indented from the left margin - using either
  540. spaces or Tab characters - it will not move any part of that
  541. line up to the previous line.
  542.  
  543. This is a handy way to prevent reformatting of certain lines.
  544. Suppose the input file looks like this:
  545.  
  546. Line one.
  547. Line two.
  548.   Line three.
  549.   Line four.
  550. Line five.
  551.   Line six.
  552. Line seven.
  553.  
  554. Line eight.
  555.   Line nine.
  556.  
  557.  
  558. Result of processing the file with -R0 (or no -R command):
  559.  
  560. Line one. Line two.
  561.   Line three.
  562.   Line four. Line five.
  563.   Line six. Line seven.
  564.  
  565. Line eight.
  566.   Line nine.
  567.  
  568. When WSM changes the line length, no part of an already-indented
  569. line will be merged with the one ABOVE it. However, it might be
  570. merged with any NON-INDENTED line BELOW it (whether the latter
  571. occurs depends on the argument to the -R switch - if you have
  572. used -R at all).
  573.  
  574. Try a few experiments to get a feel for how line-width
  575. reformatting (and exceptions thereto) works.
  576.  
  577.  
  578.                                                          page 13
  579.  ┌─────────────────────────────────────┐
  580.  │ WHAT HAPPENS DURING "-R" PROCESSING │
  581.  └─────────────────────────────────────┘
  582.  
  583. First, the program strips trailing spaces from all lines.
  584.  
  585. Then WSM breaks lines at a space or a hyphen. It NEVER breaks up
  586. a word unless the word already contains a hyphen. Space
  587. permitting on a given line, it leaves the part of the word to the
  588. left of the hyphen, and the hyphen itself, on the line and brings
  589. the part of the word to the right of the hyphen down to the next
  590. line. This line:
  591.  
  592. I won't look the same, post-processing, eh?
  593.  
  594. ... might look like this after WSM finishes with it:
  595.  
  596. I won't look the same, post-
  597. processing, eh?
  598.  
  599. If there isn't room on the upper line for that part of the word
  600. (plus the hyphen itself), WSM brings the ENTIRE word down to the
  601. next line, thus:
  602.  
  603. I won't look the same,
  604. post-processing, eh?
  605.  
  606. Dashes:
  607.  
  608. Hyphens sometimes appear in text files to indicate "long" dashes.
  609. WSM treats such character strings - like that -- (or that)
  610. differently from how it deals with hyphens in other situations.
  611.  
  612. Suppose the input file contains a paragraph like this:
  613.  
  614. Here are some lines --       Or:     Here are some lines -
  615. not many -- with dashes.             not many - with dashes.
  616.  
  617. If you use WSM to increase the file's right margin, the above two
  618. lines might become:
  619.  
  620. Here are a few lines -- not many -- containing dashes.
  621.  
  622.         Or:
  623.  
  624. Here are a few lines - not many - containing dashes.
  625.  
  626. WSM makes this kind of change whether or not there is a space (or
  627. more than one space) between the "dash" and the end of the line.
  628. The key here is that the "dash" must be PRECEDED by a space,
  629. which tells WSM that the hyphen is used as a "dash" and not to
  630. break a word. 
  631.  
  632.  
  633.                                                          page 14
  634.  
  635. If "dashes"--(like these)--are NOT preceded by spaces, the results
  636. might not be just right in the output file. You might need to do
  637. a bit of editing afterward, removing a space WSM will sometimes
  638. add to the right of such "dashes" in the output file (if the
  639. double hyphen falls at the very end of a line in the input file).
  640.  
  641.  
  642.  ┌────────────────────────┐
  643.  │ -W   WRITE OUTPUT FILE │
  644.  └────────────────────────┘
  645.  
  646. The -W switch tells WordSmart to write an output file and
  647. requires a file name argument. Omitting the argument causes an
  648. error message to appear, and no processing occurs - except when
  649. you've "piped" some other program's output to WSM for use as its
  650. own input. (There's more information about that in the section
  651. below called "Piping and Output Redirection.")
  652.  
  653. WSM will NEVER allow you to use the same file name for input and
  654. output when you use the -W switch. (But if you use redirection,
  655. all bets are off - see the piping/redirection information below
  656. for more about this.)
  657.  
  658. The output file name can contain path information but CANNOT
  659. contain the DOS wildcards "*" or "?".
  660.  
  661. If you specify a subdirectory that does not exist, WSM halts with
  662. an error message. (If you make that error when using the
  663. REGISTERED version and if you have used the -Q switch for "quiet"
  664. processing, WSM just beeps.)
  665.  
  666. Example - to process an input file called INPUT.DOC and write
  667. an output file called OUTPUT.DOC:
  668.  
  669.          WSM input.doc -r50 -w output.doc
  670.  
  671. Over-writing an existing output file or choosing a new name:
  672.  
  673. If you are not using the -O switch, and if you specify an output
  674. file that now exists, WSM will beep, open a window on the screen
  675. announcing that the file exists, and ask you to make one of three
  676. choices: Select a new file name, over-write the existing file, or
  677. quit.
  678.  
  679. Press "Q" or ESC to quit at once - no further action.
  680.  
  681. Press "O" to over-write the existing file (unless it is write-
  682. protected).
  683.  
  684.  
  685.                                                          page 15
  686.  
  687. Press "N" to open a window in which you type a new file name.
  688. This also opens a window first containing the message "INSERT
  689. OFF." Pressing ENTER or ESC right away cancels the new-file-name
  690. prompt and tells WSM to quit without doing anything. Or type the
  691. new output file name (including path information, if need be) at
  692. the prompt, then press ENTER to continue processing. WSM then
  693. writes the output file.
  694.  
  695. (If you decide to over-write the existing file after all, re-type
  696. its name at the new-file-name prompt. WSM presents the "over-
  697. write/new file name/quit" prompt again. Type "O" to over-write
  698. the file.)
  699.  
  700. The new-output-name prompt supports a few simple editing
  701. keystrokes: The left- and right-arrow keys move the cursor back
  702. and forth across characters in the prompt line without erasing
  703. any characters. BACKSPACE erases the character to the left of the
  704. cursor. DEL erases the character underneath the cursor.
  705.  
  706. Pressing INS toggles insert-mode on and off (and toggles the text
  707. in the smaller window from "INSERT OFF" to "INSERT ON" and back).
  708. With insert-mode ON, typing characters into the prompt line
  709. pushes any existing characters to the right; with insert-mode
  710. OFF, typing characters into the prompt over-strikes any
  711. characters now there.
  712.  
  713. You can, initially, type file names much longer than the legal
  714. DOS limit. But if you do so, after you press ENTER, WSM
  715. will beep and inform you that you've typed an illegal file
  716. name. Press ENTER after reading this error message, and you'll
  717. be returned to the new-file-name prompt.
  718.  
  719. The -W switch is one way to write an output file; using
  720. redirection is another. That method will be discussed shortly.
  721.  
  722.  
  723.  ┌───────────────────────────────┐
  724.  │ -O   OVER-WRITE EXISTING FILE │
  725.  └───────────────────────────────┘
  726.  
  727. Use the -O switch (no arguments) to suppress WSM's query about
  728. over-writing an existing output file. Example:
  729.  
  730. WSM input.doc -R50 -w output.doc -o
  731.  
  732. The -O switch can appear anywhere to the right of the input file
  733. name, and you can use the switch (without causing an error
  734. message) whether or not the output file name already exists.
  735.  
  736.  
  737.  
  738.                                                          page 16
  739.  ┌──────────────────────────────────┐
  740.  │ -F   REMOVE FORM-FEED CHARACTERS │
  741.  └──────────────────────────────────┘
  742.  
  743. Use -F (no arguments) to remove printer form-feed (FF) characters
  744. (Control-L, decimal value, 12).
  745.  
  746. If the FF character is by itself on a line, -F deletes the ENTIRE
  747. line (including line boundary). If the FF character appears at
  748. the start or end of a line containing other text, WSM will remove
  749. the FF itself but will not remove any other text on the line
  750. (aside from trailing spaces).
  751.  
  752.  ┌─────────────────────────────┐
  753.  │ -S   REMOVE MULTIPLE SPACES │
  754.  └─────────────────────────────┘
  755.  
  756. Use -S (no arguments) to reduce strings of two or more spaces in
  757. a row to a single space.
  758.  
  759. This is handy for removing, say, multiple spaces following
  760. punctuation. (Multiple spacing is not desirable if you're sending
  761. the text to a typesetting or DTP system.)
  762.  
  763. -S is also handy for unjustifying text whose writer has used
  764. multiple spaces to left/right-justify the lines. -S always leaves
  765. a SINGLE space in place of the string of multiple spaces
  766. (including at the beginnings of lines that have been indented by
  767. two or more spaces; this version of WSM is not able to remove ALL
  768. spaces at the start of lines).
  769.  
  770.  ┌──────────────────────────────────────┐
  771.  │ -I   PRINT REGISTRATION FORM/INVOICE │
  772.  └──────────────────────────────────────┘
  773.  
  774. The -I switch takes no arguments. Give the command:
  775.  
  776.         WSM -I
  777.  
  778. to print a WordSmart registration form on your printer. Make sure
  779. the printer is on and ready before giving the command. WordSmart
  780. does not do a "printer-ready?" check before starting the print
  781. routine.
  782.  
  783. -I works in both the registered and unregistered versions but is
  784. not noted in the registered version's help-screen.
  785.  
  786.  
  787.                                                          page 17
  788.  
  789.  ╓╥─────────────────────────────────────────────────────╖
  790.  ║║ -B   REMOVE BLANK LINES - *REGISTERED VERSION ONLY* ║
  791.  ╙╨─────────────────────────────────────────────────────╜
  792.  
  793. Use -B (no arguments) to remove all blank lines in the file -
  794. including lines that begin with spaces.
  795.  
  796. NOTE:  This command will NOT remove lines that begin with one or
  797.        more tab characters but that are otherwise blank (i.e.,
  798.        they contain nothing other than tabs or spaces). But lines
  799.        that begin with one or more spaces WILL be removed even if
  800.        there are tabs after the spaces.
  801.  
  802.  
  803.  ╓╥─────────────────────────────────────────────────────╖
  804.  ║║ -Q   "QUIET" PROCESSING - *REGISTERED VERSION ONLY* ║
  805.  ╙╨─────────────────────────────────────────────────────╜
  806.  
  807. Use -Q (no arguments) to suppress all WordSmart screen displays.
  808. If there is any error during processing, you are alerted to the
  809. problem only via a beep. -Q is useful if you run WSM from batch
  810. files and want full control over the screen displays during
  811. execution of the batch files.
  812.  
  813. In some situations, WSM will not beep if there is an error when
  814. you're using the -Q switch. But you can check for errors by
  815. testing for the exit code (errorlevel) WSM returns (errorlevels
  816. are discussed shortly).
  817.  
  818.  
  819.                                                          page 18
  820.  ╓┬───────────────────────────────┐
  821.  ║│ PIPING AND OUTPUT REDIRECTION │
  822.  ╙┴───────────────────────────────┘
  823.  
  824. WordSmart can take as input either a file whose name you
  825. specify on the command line, or the output of some other
  826. process - via "piping."
  827.  
  828. Suppose you use an automated search/replace program called SR that
  829. can write to standard output or can read from standard input.
  830. Examples:
  831.  
  832.         SR command | WSM [options]
  833.  
  834. Or:
  835.  
  836.  
  837.         WSM [options] | SR command
  838.  
  839. In the first case, you pipe the SR's output to WSM. In the
  840. second, you pipe WSM's output to SR.
  841.  
  842. When you tell WSM to get its information from standard input, do
  843. NOT put the name of an input file into the WSM command line.
  844.  
  845. Given a command like the following:
  846.  
  847.         another_program | WSM input.doc [options]
  848.  
  849. ... WSM completely ignores the piped information and reads
  850. only INPUT.DOC, instead.
  851.  
  852. Writing output files using redirection:
  853.  
  854. You can use WSM's -W switch to write an output file, or you can
  855. use DOS redirection (">" and ">>").
  856.  
  857. Using ">" can be risky. Suppose you'd like to process the file
  858. INPUT.DOC and over-write it with the changed version - same file
  859. name - rather than write a new file. So you give this command:
  860.  
  861. WSM input.doc [options] > input.doc
  862.  
  863. Result: A file called INPUT.DOC that is only ZERO BYTES LONG.
  864. Definitely not what you wanted.
  865.  
  866. Reason: DOS (not WSM) creates the zero-byte file. Then WSM reads
  867. the input file. But by that time, there isn't anything to read
  868. other than a zero-byte file! If you have only one copy of
  869. INPUT.DOC, you'll have lost it for good.
  870.  
  871.  
  872.                                                          page 19
  873.  
  874. Don't EVER try to over-write your existing file that way. Play
  875. it safe; process the file as follows:
  876.  
  877.         WSM input.doc [options] > output.doc
  878.  
  879. I.e., use a different output file name (or forget redirection
  880. and use WordSmart's -W switch).
  881. The following sort of command is also risky:
  882.  
  883.         WSM [options] < input.doc > input.doc
  884.  
  885. It might work well at some times, but destroy or corrupt your
  886. input file at other times. The following is much safer:
  887.  
  888.         WSM [options] < input.doc > output.doc
  889.  
  890. The following doesn't work, either:
  891.  
  892.         WSM input.doc [options] -w output.doc > new.doc
  893.  
  894. You think, perhaps, that you can create two identical output files
  895. at the same time - OUTPUT.DOC and NEW.DOC? Doesn't work. In that
  896. case, WSM writes OUTPUT.DOC and DOS itself writes a zero-byte file
  897. called NEW.DOC.
  898.  
  899. Redirection and screen displays:
  900.  
  901. When you use redirection, you don't give WSM.EXE enough
  902. information to create complete screen displays. If you pipe
  903. information to WSM, it doesn't display a proper input file name -
  904. because there isn't an input file to begin with.
  905.  
  906. If you write an output file via redirection, the WSM screen
  907. display doesn't show any output file name.
  908.  
  909.  
  910.                                                          page 20
  911.  ╓┬─────────────┐
  912.  ║│ ERRORLEVELS │
  913.  ╙┴─────────────┘
  914. WordSmart returns 7 different exit codes (errorlevels):
  915.  
  916. Code    Meaning
  917.  
  918. 0      Processing was successful
  919.  
  920. 1     "Read" error - couldn't find the specified input file.
  921.  
  922. 2      Can't write the output file because you gave it the same
  923.        name as the input file.
  924.  
  925.       (NOTE: Using output redirection completely defeats
  926.       WordSmart's ability to check for that kind of error.)
  927.  
  928. 3      Can't over-write the specified output file - it now
  929.        exists (and you haven't used the -O switch).
  930.  
  931. 4      Can't write the specified output file - you've given
  932.        a drive and/or path name that doesn't exist. WSM also
  933.        returns this errorlevel if you try to write an output
  934.        file to a floppy drive that isn't ready, or to a write-
  935.        protected disk.
  936.  
  937. 5      Can't over-write the existing file because it's write-
  938.        protected.
  939.  
  940. 255    Returned if you type WSM without any command-line
  941.        options at all.
  942.  
  943.  
  944. The errorlevels become most useful when you're running WSM from a
  945. batch file and are using the -Q ("quiet") switch, in which case
  946. there are no screen displays at all.
  947.  
  948. See the file WORDSMRT.BAT for a simple example of checking for the
  949. return of errorlevels in a batch file. The batch file uses WSM's
  950. -Q switch, which will not function if you don't yet have the
  951. registered version of WSM; but you will still be able to see how
  952. the errorlevel-checking works. (The presence of -Q in the command
  953. line will not cause the unregistered version to return any error
  954. messages.)
  955.  
  956.  ╓┬───────────────────┐
  957.  ║│ ABOUT EXAMPLE.BAT │
  958.  ╙┴───────────────────┘
  959. EXAMPLE.BAT, included in the WordSmart distribution archive, is a
  960. simple batch file that shows the results of processing using
  961. various -R commands.
  962.  
  963. EXAMPLE.BAT uses the file you're reading right now (WORDSMRT.DOC)
  964. for input, and it writes an output file called XXXXXXX_._XX. Once
  965. you're done using EXAMPLE.BAT, be sure to delete XXXXXXX_._XX.
  966.  
  967.  
  968.                                                          page 21
  969.  
  970. Type EXAMPLE at the DOS prompt for information on the batch
  971. file's syntax.
  972.  
  973. I hope you find WordSmart useful. I will greatly appreciate your
  974. registering it.
  975.  
  976. -- Lambert Klein
  977.  
  978.  
  979.  ┌┬───────────────────────────────────────────────────┬┐
  980.  ││ Documentation by Mike Arst, CompuServe 70403,1337 ││
  981.  └┴───────────────────────────────────────────────────┴┘
  982.  
  983.  
  984.  
  985.  
  986.  ┌┬────────────────────────┬┐
  987.  ││ REGISTRATION BENEFITS: ││
  988.  └┴────────────────────────┴┘
  989.  
  990. You have a 30-day evaluation period to try out WordSmart.
  991. After 30 days you must register WordSmart to legally continue
  992. its use.
  993.  
  994. When you register WordSmart you receive the following:
  995.  
  996. 1. A disk with the Registered version of WordSmart,
  997.    branded with your name and serial number.
  998.  
  999. 2. Other Shareware and Freeware.
  1000.  
  1001. 3. A printed manual for WordSmart.
  1002.  
  1003. 4. Voice, mail and Email support.
  1004.  
  1005. 5. Any extra features that are added to WordSmart. This
  1006.    will include the -B switch to remove blank lines, and
  1007.    the -Q switch for quiet screen during processing.
  1008.  
  1009. 6. The great feeling of registering a high-caliber program
  1010.    at a very reasonable price!
  1011.  
  1012. To print the registration form type     WSM -I [Enter]
  1013. at the Dos prompt.
  1014.  
  1015. Thank you for your support!
  1016.  
  1017.  Lambert Klein
  1018.  PO Box 611
  1019.  Wayne MI  48184
  1020.  
  1021. You can register WordSmart on CompuServe also. Just "GO SWREG".
  1022.  
  1023. Program Title:          WordSmart Version 1.0
  1024. Registration ID:        562
  1025.  
  1026.